The present invention relates generally to computer processor systems, and more specifically, to lightweight interrupts for condition checking in a computer processor system.
In computer systems that require a variety of system functions to be controlled in a nonsequential fashion, it is a common practice to employ interrupts to determine the order in which various operations are to be performed by the processor. An interrupt is generated in response to the occurrence of a predetermined event in the operation of the system. When the processor receives an interrupt request, it stops its present operation at an appropriate point and proceeds to a predetermined subroutine that controls the function associated with that particular interrupt. The predetermined condition may be an exception condition in the processor. The occurrence of an exception may result in generation of an interrupt that passes control from an application that was running at the time the exception occurred to supervisor software, so that the supervisor software can handle the exception. However, processing of interrupts by the supervisor software may negatively impact performance of the computer system.
A compiler or an application program may insert checking instructions into compiled code, such as pointer bounds checks, array index checks, and zero checks. Various special instructions may be used to perform such checking. However, detection of conditions that do not meet the checking criteria by the special instructions cause supervisor interruptions, which may impact performance. Additionally, the special instructions take time to execute and increase code footprints. An alternative to using special checking instructions is to include explicit bounds checking instructions such as register compares and conditional branches in in-line code that check each result to determine if it is within an acceptable bound. However, such explicit checks may require multiple instructions that significantly increase code footprint, take time to execute, and must be repeated each time checking needs to be performed.